// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Components/Widget.h"
#include "ToastWidget.generated.h"

class SToastSlate;

UCLASS(meta=(DisplayName="Toast"))
class MISCELLANEOUSPROJECT_API UToastWidget : public UWidget
{
	GENERATED_BODY()
	
public:
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Toast")
	FVector2D ToastSize;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Toast")
	FMargin ToastPadding;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Toast")
	FSlateBrush ToastBrush;
	
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Text", meta=(MultiLine="true"))
	FText ToastText;
	UPROPERTY()
	FGetText ToastTextDelegate;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Text")
	FTextBlockStyle TextFont;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Text")
	FSlateBrush TextBackground;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Text")
	FScrollBarStyle ScrollBrush;
	
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Icon")
	bool ShowIcon;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Icon", meta=(EditCondition="ShowIcon"))
	FSlateBrush IconBrush;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Icon")
	FVector2D IconSize;
	
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Mask")
	bool ShowMask;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Mask", meta=(EditCondition="ShowMask"))
	FSlateBrush MaskBrush;
	
public:
	UToastWidget();
	virtual void SynchronizeProperties() override;
	virtual TSharedRef<SWidget> RebuildWidget() override;
	void ReleaseSlateResources(bool bReleaseChildren);

#if WITH_EDITOR
	//	virtual const FSlateBrush* GetEditorIcon() override;
	virtual const FText GetPaletteCategory() override;
#endif
	
protected:
	PROPERTY_BINDING_IMPLEMENTATION(FText, ToastText);
	
private:
	TSharedPtr<SToastSlate> MyToastSlate;
	
};
